#include <stdio.h>

int sum_array(const int a[], int n);

int main(void)
{
    int a[3] = {4, 6, 8};
    int n = 3;

    printf("%d\n", sum_array(a, n));
}

int sum_array(const int a[], int n)
{
    const int *p;
    int sum = 0;

    for (p = a; p < a + n; p++)
        sum += *p;

    return sum;
}